Towards an ASM Thesis for Reflective Sequential Algorithms

نویسندگان

  • Flavio Ferrarotti
  • Loredana Tec
  • José Maria Turull Torres
چکیده

Starting from Gurevich’s thesis for sequential algorithms (the so-called “sequential ASM thesis”), we propose a characterization of the behaviour of sequential algorithms enriched with reflection. That is, we present a set of postulates which we conjecture capture the fundamental properties of reflective sequential algorithms (RSAs). Then we look at the plausibility of an ASM thesis for the class of RSAs, defining a model of abstract state machine (which we call reflective ASM) that we conjecture captures the class of RSAs as defined by our postulates. 1 Reflective Sequential Algorithms In this paper we are concerned with linguistic reflection [6], which can be defined as the ability of an algorithm to change itself. In the field of computable functions this idea of reflection is as old as the field itself, think for instance of universal Turing machines. It has also been implemented in many programming languages. A prime example is LISP [5], where programs and data are represented uniformly as lists, and thus programs represented as data can be executed dynamically by means of an evaluation operator. Database theory is another field in which reflection has been deeply studied. It was shown that reflection can increase the expressive power of relational algebra [3] and relational machines [1]. Nowadays, most programming languages allow for some form of dynamic SQL, where the SQL queries are produced and evaluated dynamically during the program run-time, as opposed to static SQL where the queries are fixed at the time of compilation. In the field of behavioural theory of algorithms however, linguistic reflection has not (up to our knowledge) been formally studied yet. This is surprising since dynamic self modifying code is a matter of increasing practical importance and key for the development of type-safe, dynamic agents, autonomous computing, ⋆ The research reported in this paper results from the project Behavioural Theory and Logics for Distributed Adaptive Systems supported by the Austrian Science Fund (FWF: [P26452-N15]). The final publication is available at Springer via http://dx.doi.org/10.1007/978-3-319-33600-8_16 and adaptive systems among others. The development of a good theoretical basis to describe, understand and prove properties of such systems, is then a pressing issue. Our aim in this work is to contribute to the development of a behavioural theory of reflective algorithms. In particular, we are concerned with reflective sequential algorithms (RSAs), i.e., algorithms which are sequential in the precise sense of Gurevich’s famous thesis [4], but which have the additional ability to change themselves. In the remaining part of this section we propose to capture the class of RSAs by means of three postulates which naturally extend the sequential time, abstract state and bounded exploration postulates in Gurevich’s thesis [4]. Then, in Section 2 we define a model of reflective ASM which we conjecture capture the class of RSAs as defined by our postulates. Section 3 concludes this short paper with two examples of RSAs which satisfy our postulates. Similar to Gurevich’s thesis for sequential algorithms [4], our first postulate states that every RSA works in sequential time. The key difference is that RSAs need to be able to change themselves. Thus, it seems natural to consider every state of a RSA as an extended state which includes (a representation of) a sequential algorithm (in the precise sense of Gurevich’s thesis [4]) as part of it. In this way, transitions from one step to the next can also involve changes to the algorithm which now forms part of the state. Given a state S and a sequential algorithm A, we use (S, A) to denote an extended state which extends S with (a representation of) A. Postulate 1 (Reflective Sequential Time Postulate) A RSA A consists of the following: – A non-empty set SA of extended states, where each state is extended with (a representation of) a sequential algorithm which forms part of the state. – A non-empty subset IA ⊆ SA of initial extended states such that for all (Si, Ai), (Sj , Aj) ∈ IA, Ai = Aj (i.e., such that all initial extended states of A contain exactly the same sequential algorithm). – A one-step transformation function τA : SA → SA such that τA((Si, Ai)) = (Sj , Aj) iff τAi((Si, Ai)) = (Sj , Aj), where τAi denotes the one-step transformation function of the sequential algorithm Ai. The concept of run remains the same as in the thesis for sequential algorithms, except that we consider extended states instead of arbitrary states. That is, a run or computation of A is a sequence of extended states (S0, A0), (S1, A1), (S2, A2), . . . , where (S0, A0) is an initial extended state in IA and (Si+1, Ai+1) = τA((Si, Ai)) holds for every i ≥ 0. While behavioural equivalent sequential algorithms have the same runs, this is not necessarily the case for RSA. In fact we can think of different runs (S0, A0), (S1, A1), (S2, A2), . . . , and (S ′ 0, A ′ 0), (S ′ 1, A ′ 1), (S ′ 2, A ′ 2), . . . , where Si = Si and Ai is behavioural equivalent (in the classical sense) to A ′ i for every i ≥ 0. Since such runs clearly represent the same behaviour, we call them essentially equivalent runs and define behavioural equivalent RSAs as RSAs which have essentially equivalent classes of runs. As in the sequential ASM thesis, our second postulate defines (extended) states as first-order structures. However, extended states are not just arbitrary first-order structures, since each extended state must also include (an encoding of) a sequential algorithm given by a finite text. It is important to note that the vocabulary of a RSA is not necessarily fixed. That is, we do not only allow RSAs to change themselves, but also to change their vocabularies. Postulate 2 (Reflective Abstract State Postulate) – Extended states of RSAs are first-order structures. – Every extended state (S, A) is formed by the union of an arbitrary first-order structure S and a finite first-order structure SA which encodes the sequential algorithm A. – The one-step transformation τA of a RSA A does not change the base set of any extended state of A. – The sets SA and IA of, respectively, extended states and initial extended states of a RSA A, are both closed under isomorphisms. – Any isomorphism between two extended states (S1, A1) and (S2, A2) of a RSA A, is also an isomorphism from τA((S1, A1)) to τA((S2, A2)). Our next (key) definition of strong coincidence of two extended states over a set of ground terms, is based on the fact that by the sequential accessibility principle of the ASM thesis for sequential algorithms [4], the only way in which A can access an element a of the base set of the state (S, A) is by producing a ground term that evaluates to a in (S, A). Definition 1. Following the standard approach in reflective programming [6], for every extended state (S, A), we fix a total surjective function raise(S,A) : SA → GroundA which maps (raises) elements from the domain SA of the finite structure SA that encodes A, to (the level of) well formed ground terms in the finite set GroundA formed by all the ground terms used by the sequential algorithm A to access elements of the extended state (S, A). Let (S, A) be an extended state, let ΣS and ΣA be the vocabularies of S and of the finite structure SA which encodes the sequential algorithm A, respectively, let val (S,A)(t) denote the interpretation in (S, A) of a ground term t of vocabulary ΣS ∪ΣA, and let valSA(t) denote the interpretation in SA of a ground term t of vocabulary ΣA. We say that two extended states (S1, A1) and (S2, A2) strongly coincide on a set WS ∪WA of ground terms of vocabulary (ΣS1 ∪ΣA1)∩ (ΣS2 ∪ ΣA2) and ΣA1 ∩ΣA2 , respectively, iff the following holds: – For every t ∈ WS , val (S1,A1)(t) = val (S2,A2)(t). – For every t ∈ WA and corresponding a1 = valSA1 (t) and a2 = valSA2 (t), • raise(S1,A1)(a1) = raise(S2,A2)(a2), and • val (S1,A1)(raise(S1,A1)(a1)) = val (S2,A2)(raise(S2,A2)(a2)). We can now introduce our third and last postulate. It generalizes the bounded exploration postulate for sequential algorithms in [4] to RSAs. The key difference with the analogous postulate in the sequential ASM thesis, is that we use a stronger notion of coincidence. This is necessary because for each RSA A, we want to have a finite bounded exploration witness set WA which allows us to “extract” from every extended state (Si, Ai) of A, a corresponding bounded exploration witness WAi for Ai (in the sense of the sequential ASM thesis). Let (S, A) be the extended state of a RSA A, we use ∆(S, A) to denote the unique set of updates produced by the sequential algorithm A in the extended state (S, A), which by virtue of Postulate 1 coincides with the set of updates produced by the RSA A in the extended state (S, A). The formal definition of update and update set produced by a sequential algorithm is exactly the same as in [4,2]. Postulate 3 (Reflective Bounded Exploration Postulate) For every RSA A, there is a finite set WS ∪WA of ground terms (called reflective bounded exploration witness) such that ∆(S1, A1) = ∆(S2, A2) whenever extended states (S1, A1) and (S2, A2) of A strongly coincide on WS ∪WA. A reflective sequential algorithm (RSA) is an algorithm satisfying the Reflective Sequential Time, Reflective Abstract State and Reflective Bounded Exploration Postulates. In our next section we introduce a model of ASM machine which we conjecture characterizes this class of RSAs.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Sequential ASM Thesis

The thesis is that every sequential algorithm, on any level of abstraction, can be viewed as a sequential abstract state machine [Gurevich 1985, 1991]. Abstract state machines (ASMs) used to be called evolving algebras. The sequential ASM thesis and its extensions [Gurevich 1995] inspired diverse applications of ASMs. The early applications were driven, at least partially, by the desire to test...

متن کامل

THE LOGIC IN COMPUTER SCIENCE COLUMN 1 by Yuri GUREVICH

The thesis is that every sequential algorithm, on any level of abstraction, can be viewed as a sequential abstract state machine [Gurevich 1985, 1991]. Abstract state machines (ASMs) used to be called evolving algebras. The sequential ASM thesis and its extensions [Gurevich 1995] inspired diverse applications of ASMs. The early applications were driven, at least partially, by the desire to test...

متن کامل

20 Years after A New Thesis: The Diversification of the ASM Method

20 years ago Gurevich formulated A New Thesis [10], soliciting descriptions of computational devices to unfold the underlying notion of “dynamic structures”. 10 years later, after extensive experimentation with “dynamic algebras” by a at the time still small community, Gurevich discovered a mathematical definition for “evolving algebras” [11], which remained stable except for the final name cha...

متن کامل

On Gurevich’s Theorem for Sequential ASM

Abstract-State Machines have been introduced as “a computation model that is more powerful and more universal than standard computation models”, by Yuri Gurevich in 1985 ([Gur85]). ASM gained much attention as a specification method, in particular for the description of the semantics of programming languages, communication protocols, distributed algorithms, etc. Gurevich proved recently that a ...

متن کامل

A Customised ASM Thesis for Database Transformations

Database transformations consist of queries and updates which are two fundamental types of computations in all databases the first provides the capability to retrieve data and the second is used to maintain databases in light of ever-changing application domains. With the rising popularity of webbased applications and service-oriented architectures, database queries and updates become closely r...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016